package com.bestv.search.common.dao;

import com.bestv.search.common.model.Info;
import com.bestv.search.common.model.TopKeyword;
import com.bestv.search.common.model.TopNCache;

import java.text.ParseException;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;

public interface InfoDao extends GenericDao<Info, Long> {

    List<Info> getInfos();

    List<Info> getInfoListByCode(String code);

    List<Info> getInfoByCode(String code);

    List<Info> getInfoByCode(List<String> codes);

    Set<Info> getInfoSetByIds(Object ids);

    Set<Info> getInfoSetByCodes(Object codes);

    Set<Info> getInfoSetByIds(String ids, Map<String, String> otherConditions) throws ParseException;

    int getDistinctCountOfKeysInPtype(String ptype);

    int getDistinctCountOfTagsInPtype(String ptype);

    List<Info> getOverdueSchedule(int validPeiod);

    List<Info> getInfoLikeName(String name, int start, int limit);

    int getInfoCountLikeName(String name);

    List<Info> getInfoByNames(String[] names);

    List<Info> getInfoByNames(String[] names, String p_type);

    String getNetInfoIdByMediaCode(String mediaCode);

    List<Object[]> getComparedInfo(String mediaCode, String p_type);

    int getCountByType(String infoType);

    int getRowCount(String[] names);

    Info saveInfo(Info info);

    void saveInfoList(List<Info> list);

    void saveUpdateInfoList(List<Info> list);

    void saveUpdateInfo(Info info);

    List<String> findPTypes();

    String[][] findEachKeyAndNumInPType(String ptype, int start, int limit);

    String[][] findEachTagAndNumInPtype(String ptype, int start, int limit);

    List<Integer> findCrossKeyword();

    List<String> findCrossKeywordDetail(String ptype1, String ptype2, int start, int limit);

    List<Info> getInfosByType(int stat, int lmt, String type);

    Map<String, Integer[]> findProAndKeyNumInPTypes();

    Map<String, Integer[]> findProAndTagNumInPTypes();

    int findCrossKeyCount(String ptype1, String ptype2);

    void delete(Long id);

    List<Info> searchInfoByNames(String[] names, int firstResult, int maxResult);

    List<String> getInfoCodesByNameGenreTag(String word);

    int getOnLineInfosCount();

    List<Info> getOnLineInfos(int start, int limit);

    List<Info> getInfosByUpdateTimeForIndex(Date updateIndexTimeForIndex);

    List<TopNCache> getInfosTopNCache(String category, String topNType);

    Map<String, Integer> getMaxHitCountByTags(String p_type);

    int getOnLineInfoCountByTopKeyword(TopKeyword topKeyword);
}
